package net.pws.oos.biz.model;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * 站点
 * @author ldz
 *
 */
@Entity
@Table(name = "s_station")
public class Station extends Identifier {

	private static final long serialVersionUID = -2165229348311980484L;

	/**
	 * 站点编码
	 */
	private String code;

	/**
	 * 站点名称
	 */
	private String name;

	/**
	 * 站点描述
	 */
	private String description;
	
	/**
	 * 站点扩展字段
	 */
	@OneToOne(mappedBy="station")
	private StationRecord stationRecord;

	/**
	 * 创建者
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "creator_id")
	private User creator;

	/**
	 * 创建时间
	 */
	@Column(name = "create_datetime")
	private Date createDateTime;

	/**
	 * 是否删除
	 */
    @Column(name = "has_deleted")
    private Boolean deleted = Boolean.FALSE;

	/**
	 * 删除者
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "deletor_id")
	private User deletor;
    
	/**
	 * 删除时间
	 */
	@Column(name = "delete_datetime")
	private Date deleteDateTime;

	
	
	
	/**
	 * 工程期数
	 */
	@Column(name = "proj_periods")
	private String projectPeriods;
	
	/**
	 * 地州
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "area_id")
	private Area area;
	
	/**
	 * 区县
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "county_id")
	private Area county;
	
	/**
	 * 乡镇
	 */
	@Column(name = "towns")
	private String towns;
	
	/**
	 * 站点类别
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "station_type")
	private IndicatorValue stationType;
	
	/**
	 * 基站名称
	 */
	@Column(name = "base_station_ame")
	private String baseStationName;
	
	/**
	 * 基站编码
	 */
	@Column(name = "base_station_code")
	private String baseStationCode;
	
	/**
	 * 主选点名称
	 */
	@Column(name = " main_separation")
	private String mainSeparation;
	
	/**
	 * 基站地址
	 */
	@Column(name = "base_station_site")
	private String baseStationSite;
	
	/**
	 * 海拔高度
	 */
	@Column(name = "altitude")
	private BigDecimal altitude;
	
	/**
	 * 相对高度
	 */
	@Column(name = "relative_height")
	private BigDecimal relativeHeight;

	/**
	 * 二搬距离
	 */
	@Column(name = "second_move_distance")
	private BigDecimal secondMoveDistance;

	/**
	 * 站址属性
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "site_properties")
	private IndicatorValue siteProperties;
	
	/**
	 * 配套产权归属
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "property_ownership")
	private IndicatorValue propertyOwnership;
	
	/**
	 * 区域类型
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "area_type")
	private IndicatorValue areaType;
	
	/**
	 * 覆盖目标
	 */
	@Column(name = "covering_target")
	private String coveringTarget;

	/**
	 * 工程建设模式
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "construction_model")
	private IndicatorValue constructionModel;
	
	/**
	 * 站点是否有效
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "site_valid")
	private IndicatorValue siteValid;
	
	/**
	 * 站点无效原因
	 */
	@Column(name = "site_valid_reason")
	private String siteValidReason;
	
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public StationRecord getStationRecord() {
		return stationRecord;
	}

	public void setStationRecord(StationRecord stationRecord) {
		this.stationRecord = stationRecord;
	}

	public User getCreator() {
		return creator;
	}

	public void setCreator(User creator) {
		this.creator = creator;
	}

	public Date getCreateDateTime() {
		return createDateTime;
	}

	public void setCreateDateTime(Date createDateTime) {
		this.createDateTime = createDateTime;
	}

	public Boolean getDeleted() {
		return deleted;
	}

	public void setDeleted(Boolean deleted) {
		this.deleted = deleted;
	}

	public User getDeletor() {
		return deletor;
	}

	public void setDeletor(User deletor) {
		this.deletor = deletor;
	}

	public Date getDeleteDateTime() {
		return deleteDateTime;
	}

	public void setDeleteDateTime(Date deleteDateTime) {
		this.deleteDateTime = deleteDateTime;
	}

	public String getProjectPeriods() {
		return projectPeriods;
	}

	public void setProjectPeriods(String projectPeriods) {
		this.projectPeriods = projectPeriods;
	}

	public Area getArea() {
		return area;
	}

	public void setArea(Area area) {
		this.area = area;
	}

	public Area getCounty() {
		return county;
	}

	public void setCounty(Area county) {
		this.county = county;
	}

	public String getTowns() {
		return towns;
	}

	public void setTowns(String towns) {
		this.towns = towns;
	}

	public IndicatorValue getStationType() {
		return stationType;
	}

	public void setStationType(IndicatorValue stationType) {
		this.stationType = stationType;
	}

	public String getBaseStationName() {
		return baseStationName;
	}

	public void setBaseStationName(String baseStationName) {
		this.baseStationName = baseStationName;
	}

	public String getBaseStationCode() {
		return baseStationCode;
	}

	public void setBaseStationCode(String baseStationCode) {
		this.baseStationCode = baseStationCode;
	}

	public String getMainSeparation() {
		return mainSeparation;
	}

	public void setMainSeparation(String mainSeparation) {
		this.mainSeparation = mainSeparation;
	}

	public String getBaseStationSite() {
		return baseStationSite;
	}

	public void setBaseStationSite(String baseStationSite) {
		this.baseStationSite = baseStationSite;
	}

	public BigDecimal getAltitude() {
		return altitude;
	}

	public void setAltitude(BigDecimal altitude) {
		this.altitude = altitude;
	}

	public BigDecimal getRelativeHeight() {
		return relativeHeight;
	}

	public void setRelativeHeight(BigDecimal relativeHeight) {
		this.relativeHeight = relativeHeight;
	}

	public BigDecimal getSecondMoveDistance() {
		return secondMoveDistance;
	}

	public void setSecondMoveDistance(BigDecimal secondMoveDistance) {
		this.secondMoveDistance = secondMoveDistance;
	}

	public IndicatorValue getSiteProperties() {
		return siteProperties;
	}

	public void setSiteProperties(IndicatorValue siteProperties) {
		this.siteProperties = siteProperties;
	}

	public IndicatorValue getPropertyOwnership() {
		return propertyOwnership;
	}

	public void setPropertyOwnership(IndicatorValue propertyOwnership) {
		this.propertyOwnership = propertyOwnership;
	}

	public IndicatorValue getAreaType() {
		return areaType;
	}

	public void setAreaType(IndicatorValue areaType) {
		this.areaType = areaType;
	}

	public String getCoveringTarget() {
		return coveringTarget;
	}

	public void setCoveringTarget(String coveringTarget) {
		this.coveringTarget = coveringTarget;
	}

	public IndicatorValue getConstructionModel() {
		return constructionModel;
	}

	public void setConstructionModel(IndicatorValue constructionModel) {
		this.constructionModel = constructionModel;
	}

	public IndicatorValue getSiteValid() {
		return siteValid;
	}

	public void setSiteValid(IndicatorValue siteValid) {
		this.siteValid = siteValid;
	}

	public String getSiteValidReason() {
		return siteValidReason;
	}

	public void setSiteValidReason(String siteValidReason) {
		this.siteValidReason = siteValidReason;
	}

}
